Types of light Dependent Resistors
1. Intrinsic Photo Resistors
2. Extrinsic Photo Resistors
Applications of Light Dependent Resistor
/* Name : main.c
* Purpose : Source code for LDR Interfacing with Arduino.
* Author : Gemicates
* Date : 29-01-2018
* Website : www.gemicates.org
* Revision : None
*/
#include"Arduino.h"
const int led=9; // variable which stores pin number
void setup()
{
pinMode(led, OUTPUT); //configures pin 9 as OUTPUT
}
void loop()
{
int sensor_value = analogRead(A1);
if (sensor_value > 150) // the point at which the state of LEDs change
{
digitalWrite(led, HIGH); //sets LEDs ON
}
else
{
digitalWrite(led,LOW); //Sets LEDs OFF
}
}